﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using UvsChess;
using StudentAI;

namespace ChessUnitTest
{
    [TestClass]
    public class TestMoveValidations
    {
        #region Explanation
        //Board State Example
        //rnbqkbnr/
        //p2ppppp/
        //8/
        //1pp6/
        //1PP6/
        //8/
        //P2PPPPP/
        //RNBQKBNR
        #endregion
        //#region PawnTests
        //[TestMethod]
        //public void TestPawnValidation()
        //{
        //    string StartingBoardState = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";
        //    string Blocked = "rnbqkbnr/p1pppppp/8/1p6/1P6/8/P1PPPPPP/RNBQKBNR";
        //    //rnbqkbnr/
        //    //p_pppppp/
        //    //________/
        //    //_p______/
        //    //_P______/
        //    //________/
        //    //P1PPPPPP/
        //    //RNBQKBNR
        //    string CanOnlyCapture = "rnbqkbnr/p2ppppp/8/1pp6/1PP6/8/P2PPPPP/RNBQKBNR";
        //    //rnbqkbnr/
        //    //p__ppppp/
        //    //________/
        //    //_pp_____/
        //    //_PP_____/
        //    //________/
        //    //P__PPPPP/
        //    //RNBQKBNR

        //    //Game just starting
        //    //Test Pawn moves
        //    //Test Black
        //    //Forward
        //    for (int y = 0; y < ChessBoard.NumberOfRows; y++)
        //    {
        //        for (int x = 0; x < ChessBoard.NumberOfColumns; x++)
        //        {
        //            if (x == 1 && y == 2) { 
        //                Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState),
        //                                                              new ChessMove( new ChessLocation(1,1),
        //                                                                             new ChessLocation(x,y)),
        //                                                              ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState),
        //                                                              new ChessMove(new ChessLocation(1, 6),
        //                                                                             new ChessLocation(x, y)),
        //                                                              ChessColor.White));
        //            }
        //            else if (x == 1 && y == 3) {
        //                Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState),
        //                                                              new ChessMove(new ChessLocation(1, 1),
        //                                                                             new ChessLocation(x, y)),
        //                                                              ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState),
        //                                                              new ChessMove(new ChessLocation(1, 6),
        //                                                                             new ChessLocation(x, y)),
        //                                                              ChessColor.White));
        //            }
        //            else if (x == 1 && y == 5) {
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState),
        //                                                              new ChessMove(new ChessLocation(1, 1),
        //                                                                             new ChessLocation(x, y)),
        //                                                              ChessColor.Black));
        //                Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState),
        //                                                              new ChessMove(new ChessLocation(1, 6),
        //                                                                             new ChessLocation(x, y)),
        //                                                              ChessColor.White));
        //            }
        //            else if (x == 1 && y == 4)
        //            {
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState),
        //                                                              new ChessMove(new ChessLocation(1, 1),
        //                                                                             new ChessLocation(x, y)),
        //                                                              ChessColor.Black));
        //                Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState),
        //                                                              new ChessMove(new ChessLocation(1, 6),
        //                                                                             new ChessLocation(x, y)),
        //                                                              ChessColor.White));
        //            }
        //            else
        //            {
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState),
        //                                                              new ChessMove(new ChessLocation(1, 1),
        //                                                                             new ChessLocation(x, y)),
        //                                                              ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState),
        //                                                              new ChessMove(new ChessLocation(1, 6),
        //                                                                             new ChessLocation(x, y)),
        //                                                              ChessColor.White));
        //            }
        //        }
        //    }
        //    Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 1), new ChessLocation(1, 2)), ChessColor.Black));
        //    Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 1), new ChessLocation(1, 3)), ChessColor.Black));
        //    //Anything else
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 1), new ChessLocation(2, 2)), ChessColor.Black));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 1), new ChessLocation(2, 1)), ChessColor.Black));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 1), new ChessLocation(2, 0)), ChessColor.Black));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 1), new ChessLocation(1, 0)), ChessColor.Black));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 1), new ChessLocation(0, 0)), ChessColor.Black));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 1), new ChessLocation(0, 1)), ChessColor.Black));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 1), new ChessLocation(0, 3)), ChessColor.Black));

        //    //Test White
        //    //Forward
        //    Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 6), new ChessLocation(1, 5)), ChessColor.White));
        //    Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 6), new ChessLocation(1, 4)), ChessColor.White));
        //    //Anything else
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 6), new ChessLocation(2, 5)), ChessColor.White));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 6), new ChessLocation(2, 6)), ChessColor.White));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 6), new ChessLocation(2, 7)), ChessColor.White));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 6), new ChessLocation(1, 7)), ChessColor.White));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 6), new ChessLocation(0, 7)), ChessColor.White));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 6), new ChessLocation(0, 6)), ChessColor.White));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(StartingBoardState), new ChessMove(new ChessLocation(1, 6), new ChessLocation(0, 5)), ChessColor.White));

        //    //Test blocked, no capture
        //    for (int x = 0; x < ChessBoard.NumberOfColumns; x++) {
        //        for (int y = 0; x < ChessBoard.NumberOfRows; x++) {
        //            Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(Blocked), new ChessMove(new ChessLocation(1, 3), new ChessLocation(x, y)), ChessColor.Black));
        //            Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(Blocked), new ChessMove(new ChessLocation(1, 4), new ChessLocation(x, y)), ChessColor.White));
        //        }
        //    }
        //    //Test blocked, capture
        //    for (int x = 0; x < ChessBoard.NumberOfColumns; x++)
        //    {
        //        for (int y = 0; x < ChessBoard.NumberOfRows; x++)
        //        {
        //            if (x == 2 && y == 4)
        //            {
        //                Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(1, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(2, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(1, 4), new ChessLocation(x, y)), ChessColor.White));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(2, 4), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else if (x == 1 && y == 4) {
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(1, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(2, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(1, 4), new ChessLocation(x, y)), ChessColor.White));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(2, 4), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else if (x == 1 && y == 3) {
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(1, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(2, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(1, 4), new ChessLocation(x, y)), ChessColor.White));
        //                Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(2, 4), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else if (x == 2 && y == 3)
        //            {
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(1, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(2, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(1, 4), new ChessLocation(x, y)), ChessColor.White));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(2, 4), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else {
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(1, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(2, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(1, 4), new ChessLocation(x, y)), ChessColor.White));
        //                Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(CanOnlyCapture), new ChessMove(new ChessLocation(2, 4), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //        }
        //    }
        //}//TestPawnValidation
        //[TestMethod]
        //public void TestPawnStartingSpace2Move()
        //{            
        //    string TwoHop = "rnbqkbnr/p1pp1ppp/4p3/1p6/1P6/4P3/P1PP1PPP/RNBQKBNR";
        //    //01234567
        //    //rnbqkbnr/0
        //    //p_pp_ppp/1
        //    //____p___/2
        //    //_p______/3
        //    //_P______/4
        //    //____P___/5
        //    //P_PP_PPP/6
        //    //RNBQKBNR 7

        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(TwoHop), 
        //                                                   new ChessMove(new ChessLocation(4, 2), 
        //                                                                 new ChessLocation(4, 4)), 
        //                                                   ChessColor.Black));
        //    Assert.IsFalse(MoveValidation.validatePawnMove(new ChessBoard(TwoHop), 
        //                                                   new ChessMove(new ChessLocation(4,5), 
        //                                                                 new ChessLocation(4,3)), 
        //                                                   ChessColor.White));
        //    Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(TwoHop),
        //                                                   new ChessMove(new ChessLocation(5, 1),
        //                                                                 new ChessLocation(5, 3)),
        //                                                   ChessColor.Black));
        //    Assert.IsTrue(MoveValidation.validatePawnMove(new ChessBoard(TwoHop),
        //                                                   new ChessMove(new ChessLocation(5, 6),
        //                                                                 new ChessLocation(5, 4)),
        //                                                   ChessColor.White));
        //}//TestPawnValidation
        //#endregion
        //#region RookTests
        //[TestMethod]
        //public void TestRookValidation()
        //{
        //    string surroundedSameColor = "8/5P2/4PRP1/5P2/3p4/2prp3/3p4/8";
        //    string surroundedOppositeColor = "8/5P2/4PrP1/5P2/3p4/2pRp3/3p4/8";
        //    string rangeLimited = "8/3PP3/8/1P2r1p1/1P1R2p1/8/3pp3/8";

        //    //Can't move anywhere
        //    //01234567
        //    //________/0
        //    //_____P__/1
        //    //____PRP_/2
        //    //_____P__/3
        //    //___p____/4
        //    //__prp___/5
        //    //___p____/6
        //    //________ 7
        //    //8/5P2/4PRP1/5P2/3p4/2prp3/3p4/8
        //    for (int x = 0; x < ChessBoard.NumberOfColumns; x++) {
        //        for (int y = 0; y < ChessBoard.NumberOfRows; y++) {
        //            Assert.IsFalse(MoveValidation.validateRookMove(new ChessBoard(surroundedSameColor), new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.White));
        //            Assert.IsFalse(MoveValidation.validateRookMove(new ChessBoard(surroundedSameColor), new ChessMove(new ChessLocation(3, 5), new ChessLocation(x, y)), ChessColor.Black));
        //        }
        //    }
        //    //01234567
        //    //________/0
        //    //_____P__/1(5,1)
        //    //____PrP_/2(4,2)(6,2)
        //    //_____P__/3(5,3)
        //    //___p____/4(3,4)
        //    //__pRp___/5(2,5)(4,5)
        //    //___p____/6(3,6)
        //    //________ 7
        //    //8/5P2/4PrP1/5P2/3p4/2pRp3/3p4/8
        //    for (int x = 0; x < ChessBoard.NumberOfColumns; x++)
        //    {
        //        for (int y = 0; y < ChessBoard.NumberOfRows; y++)
        //        {
        //            if (x == 5 && y == 1 ||
        //                x == 4 && y == 2 ||
        //                x == 6 && y == 2 ||
        //                x == 5 && y == 3) 
        //            {
        //                Assert.IsTrue(MoveValidation.validateRookMove(new ChessBoard(surroundedOppositeColor), new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validateRookMove(new ChessBoard(surroundedOppositeColor), new ChessMove(new ChessLocation(3, 5), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else if (x == 3 && y == 4 ||
        //                x == 2 && y == 5 ||
        //                x == 4 && y == 5 ||
        //                x == 3 && y == 6)
        //            {
        //                Assert.IsTrue(MoveValidation.validateRookMove(new ChessBoard(surroundedOppositeColor), new ChessMove(new ChessLocation(3, 5), new ChessLocation(x, y)), ChessColor.White));
        //                Assert.IsFalse(MoveValidation.validateRookMove(new ChessBoard(surroundedOppositeColor), new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.Black));
        //            }
        //            else {
        //                Assert.IsFalse(MoveValidation.validateRookMove(new ChessBoard(surroundedOppositeColor), new ChessMove(new ChessLocation(3, 5), new ChessLocation(x, y)), ChessColor.White));
        //                Assert.IsFalse(MoveValidation.validateRookMove(new ChessBoard(surroundedOppositeColor), new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.Black));
        //            }
                    
        //        }
        //    }
        //    //01234567
        //    //________/0
        //    //___PP___/1
        //    //________/2
        //    //_P__r_p_/3
        //    //_P_R__p_/4
        //    //________/5
        //    //___pp___/6
        //    //________ 7
        //    //01234567
        //    //8/3PP3/8/1P2r1p1/1P1R2p1/8/3pp3/8
        //    //r - (4,1)(4,2)(4,4)(4,5)(1,3)(2,3)(3,3)(5,3)
        //    //R - (3,2)(3,3)(3,5)(3,6)(2,4)(4,4)(5,4)(6,4)
        //    for (int x = 0; x < ChessBoard.NumberOfColumns; x++)
        //    {
        //        for (int y = 0; y < ChessBoard.NumberOfRows; y++)
        //        {
        //            if ( x == 3 && y == 3 ||
        //                 x == 4 && y == 4) {
        //                Assert.IsTrue(MoveValidation.validateRookMove(new ChessBoard(rangeLimited), new ChessMove(new ChessLocation(4, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsTrue(MoveValidation.validateRookMove(new ChessBoard(rangeLimited), new ChessMove(new ChessLocation(3, 4), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else if( x == 4 && y == 1 ||
        //                     x == 4 && y == 2 ||
        //                     x == 4 && y == 4 ||
        //                     x == 4 && y == 5 ||
        //                     x == 1 && y == 3 ||
        //                     x == 2 && y == 3 ||
        //                     x == 3 && y == 3 ||
        //                     x == 5 && y == 3) 
        //            {
        //                Assert.IsTrue(MoveValidation.validateRookMove(new ChessBoard(rangeLimited), new ChessMove(new ChessLocation(4,3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validateRookMove(new ChessBoard(rangeLimited), new ChessMove(new ChessLocation(3,4), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else if ( x == 3 && y == 2 ||
        //                      x == 3 && y == 3 ||
        //                      x == 3 && y == 5 ||
        //                      x == 3 && y == 6 ||
        //                      x == 2 && y == 4 ||
        //                      x == 4 && y == 4 ||
        //                      x == 5 && y == 4 ||
        //                      x == 6 && y == 4)
        //            {
        //                Assert.IsFalse(MoveValidation.validateRookMove(new ChessBoard(rangeLimited), new ChessMove(new ChessLocation(4, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsTrue(MoveValidation.validateRookMove(new ChessBoard(rangeLimited), new ChessMove(new ChessLocation(3, 4), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else {
        //                Assert.IsFalse(MoveValidation.validateRookMove(new ChessBoard(rangeLimited), new ChessMove(new ChessLocation(4, 3), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validateRookMove(new ChessBoard(rangeLimited), new ChessMove(new ChessLocation(3, 4), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //        }
        //    }
        //}//End TestRookValidation
        //#endregion
        
        #region BishopTests
        [TestMethod]
        public void B_SurroundedSameColor()
        {
            string surroundedSameColor = "5k2/4P1P1/5B2/4P1P1/2p1p3/3b4/2p1p3/5K2";                        

            //Can't move anywhere
            //01234567
            //_____k__/0
            //____P_P_/1
            //_____B__/2
            //____P_P_/3
            //__p_p___/4
            //___b____/5
            //__p_p___/6
            //_____K__ 7
            //5k2/4P1P1/5B2/4P1P1/2p1p3/3b4/2p1p3/5K2
            ChessBoard currentBoard = new ChessBoard(surroundedSameColor);
            ChessLocation whiteKingLoc = new ChessLocation(5, 7);
            ChessLocation blackKingLoc = new ChessLocation(5, 0);
            ChessLocation whiteBishopLoc = new ChessLocation(5, 2);
            ChessLocation blackBishopLoc = new ChessLocation(2, 5);
            ChessLocation currentTo;
            ChessMove currentMove;
            for (int y = 0; y < ChessBoard.NumberOfRows; y++)
            {
                for (int x = 0; x < ChessBoard.NumberOfColumns; x++)
                {
                    currentTo = new ChessLocation(x,y);
                    currentMove = new ChessMove(whiteBishopLoc, currentTo);
                    Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.White, whiteKingLoc));
                    currentMove = new ChessMove(blackBishopLoc, currentTo);
                    Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.Black, blackKingLoc));
                }
            }
        }
        [TestMethod]
        public void B_SurroundedOpposite()
        {
            string surroundedOppositeColor = "k7/4P1P1/5b2/4P1P1/2p1p3/3B4/2p1p3/7K";
            //Can move 1 diagonal            
            //01234567
            //k_______/0
            //____P_P_/1(4,1)(6,1)
            //_____b__/2
            //____P_P_/3(4,3)(6,3)
            //__p_p___/4(2,4)(4,4)
            //___B____/5
            //__p_p___/6(2,6)(4,6)
            //_______K 7
            //k7/4P1P1/5b2/4P1P1/2p1p3/3B4/2p1p3/7K

            ChessBoard currentBoard = new ChessBoard(surroundedOppositeColor);
            ChessLocation whiteKingLoc = new ChessLocation(7, 7);
            ChessLocation blackKingLoc = new ChessLocation(0, 0);
            ChessLocation whiteBishopLoc = new ChessLocation(3, 5);
            ChessLocation blackBishopLoc = new ChessLocation(5, 2);
            ChessLocation currentTo;
            ChessMove currentMove;
            for (int y = 0; y < ChessBoard.NumberOfRows; y++)
            {
                for (int x = 0; x < ChessBoard.NumberOfRows; x++)
                {
                    currentTo = new ChessLocation(x, y);
                    if (x == 4 && y == 1 ||
                         x == 6 && y == 1 ||
                         x == 4 && y == 3 ||
                         x == 6 && y == 3)
                    {
                        currentMove = new ChessMove(blackBishopLoc, currentTo);
                        Assert.IsTrue(MoveValidation.validateBishopMove(currentBoard,currentMove,ChessColor.Black,blackKingLoc), x + " - " + y);
                        currentMove = new ChessMove(whiteBishopLoc, currentTo);
                        Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.White, whiteKingLoc), x + " - " + y);
                    }
                    else if (x == 2 && y == 4 ||
                              x == 4 && y == 4 ||
                              x == 2 && y == 6 ||
                              x == 4 && y == 6)
                    {
                        currentMove = new ChessMove(blackBishopLoc, currentTo);
                        Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.Black, blackKingLoc), x + " - " + y);
                        currentMove = new ChessMove(whiteBishopLoc, currentTo);
                        Assert.IsTrue(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.White, whiteKingLoc), x + " - " + y);                        
                    }
                    else
                    {
                        currentMove = new ChessMove(blackBishopLoc, currentTo);
                        Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.Black, blackKingLoc), x + " - " + y);
                        currentMove = new ChessMove(whiteBishopLoc, currentTo);
                        Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.White, whiteKingLoc), x + " - " + y);                        
                    }
                }
            }
        }
        [TestMethod]
        public void B_RangeLimited()
        {
            string rangeLimited = "P3p2k/8/2b5/1P1p4/4P1p1/5B2/8/K2p3P";
            //01234567
            //P___p__k/0b(0,0)
            //________/1b(1,1)(3,1)
            //__b_____/2
            //_P_p____/3b(1,3)
            //____P_p_/4B(6,4)
            //_____B__/5
            //________/6B(4,6)(6,6)
            //K__p___P 7B(3,7)
            //P3p2k/8/2b5/1P1p4/4P1p1/5B2/K2p3P

            ChessBoard currentBoard = new ChessBoard(rangeLimited);
            ChessLocation whiteKingLoc = new ChessLocation(0, 7);
            ChessLocation blackKingLoc = new ChessLocation(7, 0);
            ChessLocation whiteBishopLoc = new ChessLocation(5, 5);
            ChessLocation blackBishopLoc = new ChessLocation(2, 2);
            ChessLocation currentTo;
            ChessMove currentMove;
            for (int y = 0; y < ChessBoard.NumberOfRows; y++)
            {
                for (int x = 0; x < ChessBoard.NumberOfColumns; x++)
                {
                    currentTo = new ChessLocation(x, y);
                    if ( x == 0 && y == 0 ||
                         x == 1 && y == 1 ||
                         x == 3 && y == 1 ||
                         x == 1 && y == 3)
                    {
                        currentMove = new ChessMove(blackBishopLoc, currentTo);
                        Assert.IsTrue(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.Black, blackKingLoc));
                        currentMove = new ChessMove(whiteBishopLoc, currentTo);
                        Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.White, whiteKingLoc));
                    }
                    else if ( x == 6 && y == 4 ||
                              x == 4 && y == 6 ||
                              x == 6 && y == 6 ||
                              x == 3 && y == 7)
                    {
                        currentMove = new ChessMove(blackBishopLoc, currentTo);
                        Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.Black, blackKingLoc));
                        currentMove = new ChessMove(whiteBishopLoc, currentTo);
                        Assert.IsTrue(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.White, whiteKingLoc));
                    }
                    else
                    {
                        currentMove = new ChessMove(blackBishopLoc, currentTo);
                        Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.Black, blackKingLoc));
                        currentMove = new ChessMove(whiteBishopLoc, currentTo);
                        Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.White, whiteKingLoc));
                    }
                }
            }
        }//End TestBishopValidation
        [TestMethod]
        public void B_RevealCheck() 
        {
            string revealCheck = "5Q2/4P1P1/5b2/4PkP1/2pKp3/3B5/2p1p3/3q5";
            //01234567
            //_____Q__/0
            //____P_P_/1(4,1)(6,1)
            //_____b__/2
            //____PkP_/3(4,3)(6,3)
            //__pKp___/4(2,4)(4,4)
            //___B____/5
            //__p_p___/6(2,6)(4,6)
            //___q____ 7
            //5Q2/4P1P1/5b2/4PkP1/2pKp3/3B5/2p1p3/3q5
            ChessBoard currentBoard = new ChessBoard(revealCheck);
            ChessLocation whiteKingLoc = new ChessLocation(3, 4);
            ChessLocation blackKingLoc = new ChessLocation(5, 3);
            ChessLocation whiteBishopLoc = new ChessLocation(3, 5);
            ChessLocation blackBishopLoc = new ChessLocation(5, 2);
            ChessLocation currentTo;
            ChessMove currentMove;
            for (int y = 0; y < ChessBoard.NumberOfRows; y++)
            {
                for (int x = 0; x < ChessBoard.NumberOfColumns; x++)
                {
                    currentTo = new ChessLocation(x, y);
                    currentMove = new ChessMove(blackBishopLoc, currentTo);
                    Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.Black, blackKingLoc));
                    currentMove = new ChessMove(whiteBishopLoc, currentTo);
                    Assert.IsFalse(MoveValidation.validateBishopMove(currentBoard, currentMove, ChessColor.White, whiteKingLoc));                    
                }
            }
        }
        #endregion
        //#region KnightTests
        //[TestMethod]
        //public void TestKnightValidationSurrounded()
        //{
        //    string noMove = "4p3/6n1/4p3/5p1p/P1P5/3P4/1N6/3P4";

        //    //Can't move anywhere
        //    //01234567
        //    //____p___/0
        //    //______n_/1
        //    //____p___/2
        //    //_____p_p/3
        //    //P_P_____/4
        //    //___P____/5
        //    //_N______/6
        //    //___P____ 7 
        //    //4p3/6n1/4p3/5p1p/P1P5/3P4/1N6/3P4
        //    for (int y = 0; y < ChessBoard.NumberOfRows; y++) { 
        //        for (int x = 0; x < ChessBoard.NumberOfColumns; x++) {
        //            Assert.IsFalse(MoveValidation.validateKnightMove(new ChessBoard(noMove), new ChessMove(new ChessLocation(6,1),new ChessLocation(x,y)), ChessColor.Black));
        //            Assert.IsFalse(MoveValidation.validateKnightMove(new ChessBoard(noMove), new ChessMove(new ChessLocation(1,6),new ChessLocation(x,y)), ChessColor.White));
        //        }
        //    }                    
        //}//End TestKnightValidationSurrounded
        //[TestMethod]
        //public void TestKnightValidationAlternating()
        //{
        //    string alternatingColor = "4p1p1/3p3P/5n2/1p1p3P/p3P1P1/2N5/p3P3/1P1P4";

        //    //Can move 1 diagonal            
        //    //01234567
        //    //____p_p_/0
        //    //___p___P/1n(7,1)
        //    //_____n__/2
        //    //_p_p___P/3n(7,3)N(1,3)(3,3)
        //    //p___P_P_/4N(0,4)n(4,4)(6,4)
        //    //__N_____/5
        //    //p___P___/6N(0,6)
        //    //_P_P____ 7
        //    //4p1p1/3p3P/5n2/1p1p3P/p3P1P1/2N5/p3P3/1P1P4
        //    for (int y = 0; y < ChessBoard.NumberOfRows; y++)
        //    {
        //        for (int x = 0; x < ChessBoard.NumberOfColumns; x++)
        //        {
        //            if (x == 7 && y == 1 ||
        //                x == 7 && y == 3 ||
        //                x == 4 && y == 4 ||
        //                x == 6 && y == 4)
        //            {
        //                Assert.IsTrue(MoveValidation.validateKnightMove(new ChessBoard(alternatingColor), new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validateKnightMove(new ChessBoard(alternatingColor), new ChessMove(new ChessLocation(2, 5), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else if (x == 1 && y == 3 ||
        //                     x == 3 && y == 3 ||
        //                     x == 0 && y == 4 ||
        //                     x == 0 && y == 6)
        //            {
        //                Assert.IsFalse(MoveValidation.validateKnightMove(new ChessBoard(alternatingColor), new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsTrue(MoveValidation.validateKnightMove(new ChessBoard(alternatingColor), new ChessMove(new ChessLocation(2, 5), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else {
        //                Assert.IsFalse(MoveValidation.validateKnightMove(new ChessBoard(alternatingColor), new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.Black));
        //                Assert.IsFalse(MoveValidation.validateKnightMove(new ChessBoard(alternatingColor), new ChessMove(new ChessLocation(2, 5), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //        }
        //    }  
        //}//End TestKnightValidation
        //#endregion
        //#region KingTests
        
        //#endregion
        //#region QueenTests
        //[TestMethod]
        //public void TestQueenValidation()
        //{
        //    string surroundedSameColor = "8/4PPP1/4PQP1/4PPP1/2ppp3/2pqp3/2ppp3/8";
            

        //    //Can't move anywhere
        //    //01234567
        //    //________/0
        //    //____PPP_/1
        //    //____PQP_/2
        //    //____PPP_/3
        //    //__ppp___/4
        //    //__pqp___/5
        //    //__ppp___/6
        //    //________ 7
        //    //8/4PPP1/4PQP1/4PPP1/2ppp3/2pqp3/2ppp3/8
        //    for (int y = 0; y < ChessBoard.NumberOfRows; y++)
        //    {
        //        for (int x = 0; x < ChessBoard.NumberOfColumns; x++)
        //        {
        //            Assert.IsFalse(MoveValidation.validateQueenMove(new ChessBoard(surroundedSameColor), 
        //                new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.White));
        //            Assert.IsFalse(MoveValidation.validateQueenMove(new ChessBoard(surroundedSameColor), 
        //                new ChessMove(new ChessLocation(3, 5), new ChessLocation(x, y)), ChessColor.Black));
        //        }
        //    }

        //    //Can move 1 diagonal
        //    //01234567
        //    //________/0
        //    //____pPp_/1
        //    //____PqP_/2
        //    //____pPp_/3
        //    //__PpP___/4
        //    //__pQp___/5
        //    //__PpP___/6
        //    //________ 7
        //    //8/4pPp1/4PqP1/4pPp1/2PpP3/2pQp3/2PpP3/8
        //    string surroundedCrissCross = "8/4pPp1/4PqP1/4pPp1/2PpP3/2pQp3/2PpP3/8";
        //    for (int y = 0; y < ChessBoard.NumberOfRows; y++)
        //    {
        //        for (int x = 0; x < ChessBoard.NumberOfRows; x++)
        //        {
        //            if ( x == 4 && y == 1 ||
        //                 x == 6 && y == 1 ||
        //                 x == 4 && y == 3 ||
        //                 x == 6 && y == 3)
        //            {
        //                Assert.IsFalse(MoveValidation.validateQueenMove(new ChessBoard(surroundedCrissCross), 
        //                    new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.Black));
        //            }
        //            else if ( x == 5 && y == 1 ||
        //                      x == 4 && y == 2 ||
        //                      x == 6 && y == 2 ||
        //                      x == 5 && y == 3)
        //            {
        //                Assert.IsFalse(MoveValidation.validateQueenMove(new ChessBoard(surroundedCrissCross), 
        //                    new ChessMove(new ChessLocation(3, 5), new ChessLocation(x, y)), ChessColor.Black));
        //            }
        //            else if ( x == 2 && y == 4 ||
        //                      x == 4 && y == 4 ||
        //                      x == 2 && y == 6 ||
        //                      x == 4 && y == 6)
        //            {
        //                Assert.IsFalse(MoveValidation.validateQueenMove(new ChessBoard(surroundedCrissCross), 
        //                    new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else if(x == 3 && y == 4 ||
        //                    x == 2 && y == 5 ||
        //                    x == 4 && y == 5 ||
        //                    x == 3 && y == 6)
        //            {
        //                Assert.IsTrue(MoveValidation.validateQueenMove(new ChessBoard(surroundedCrissCross), 
        //                    new ChessMove(new ChessLocation(3, 5), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else
        //            {
        //                Assert.IsFalse(MoveValidation.validateQueenMove(new ChessBoard(surroundedCrissCross), new ChessMove(new ChessLocation(5, 2), new ChessLocation(x, y)), ChessColor.White));
        //                Assert.IsFalse(MoveValidation.validateQueenMove(new ChessBoard(surroundedCrissCross), new ChessMove(new ChessLocation(3, 5), new ChessLocation(x, y)), ChessColor.Black));
        //            }
        //        }
        //    }

        //    //01234567
        //    //P__p____/0(0,0)(3,0)
        //    //_k______/1(1,1)
        //    //________/2
        //    //___q__pR/3(3,3)(6,3)(7,3)
        //    //________/4
        //    //________/5
        //    //p_______/6(1,6)
        //    //___K____/7(3,7)            
        //    //P2p4/1k6/8/3q2pR/8/8/P7/3K4
        //    //q - (0,0)(3,0)(1,1)(6,3)(7,3)(1,6)(false state)
        //    string otherScenerio = "P2p4/1k6/8/3q2pR/8/8/p7/3K4";
        //    for (int y = 0; y < ChessBoard.NumberOfColumns; y++)
        //    {
        //        for (int x = 0; x < ChessBoard.NumberOfRows; x++)
        //        {
        //            if ( x == 2 && y == 2 || x == 4 && y == 4 ||
        //                 x == 5 && y == 5 || x == 6 && y == 6 ||
        //                 x == 7 && y == 7 || x == 3 && y == 2 ||
        //                 x == 3 && y == 1 || x == 0 && y == 3 || x == 3 && y == 1 || x == 2 && y == 4 || x == 1 && y == 5 ||
        //                 x == 1 && y == 3 || x == 2 && y == 3 || x == 4 && y == 2 || x == 5 && y == 1 || x == 6 && y == 0 ||
        //                 x == 4 && y == 3 || x == 5 && y == 3 ||
        //                 x == 3 && y == 4 || x == 3 && y == 5 ||
        //                 x == 3 && y == 6 || x == 3 && y == 7)
        //            {
        //                Assert.IsTrue(MoveValidation.validateQueenMove(new ChessBoard(otherScenerio), 
        //                    new ChessMove(new ChessLocation(3, 3), new ChessLocation(x, y)), ChessColor.Black));                        
        //            }
        //            else 
        //            {
        //                Assert.IsFalse(MoveValidation.validateQueenMove(new ChessBoard(otherScenerio), 
        //                    new ChessMove(new ChessLocation(3, 3), new ChessLocation(x, y)), ChessColor.Black));                        
        //            }
        //        }
        //    }

        //    //01234567
        //    //p__P____/0(0,0)(3,0)
        //    //_K______/1(1,1)
        //    //________/2
        //    //___Q__Pr/3(3,3)(6,3)(7,3)
        //    //________/4
        //    //________/5
        //    //P_______/6(1,6)
        //    //___k____/7(3,7)            
        //    //P2p4/1k6/8/3q2pR/8/8/P7/3K4
        //    //q - (0,0)(3,0)(1,1)(6,3)(7,3)(1,6)(false state)
        //    //q - (2,2)(4,4)(5,5)(6,6)(7,7)(3,2)(3,1)(0,3)(1,3)(2,3)(4,3)(5,3)(3,4)(3,5)(3,6)(3,7)
        //    string otherScenerioFlipped = "p2P4/1K6/8/3Q2Pr/8/8/P7/3k4";
        //    for (int y = 0; y < ChessBoard.NumberOfColumns; y++)
        //    {
        //        for (int x = 0; x < ChessBoard.NumberOfRows; x++)
        //        {
        //            if ( x == 2 && y == 2 || x == 4 && y == 4 ||
        //                 x == 5 && y == 5 || x == 6 && y == 6 ||
        //                 x == 7 && y == 7 || x == 3 && y == 2 ||
        //                 x == 3 && y == 1 || x == 0 && y == 3 || x == 3 && y == 1 || x == 2 && y == 4 || x == 1 && y == 5 ||
        //                 x == 1 && y == 3 || x == 2 && y == 3 || x == 4 && y == 2 || x == 5 && y == 1 || x == 6 && y == 0 ||
        //                 x == 4 && y == 3 || x == 5 && y == 3 ||
        //                 x == 3 && y == 4 || x == 3 && y == 5 ||
        //                 x == 3 && y == 6 || x == 3 && y == 7)
        //            {
        //                Assert.IsTrue(MoveValidation.validateQueenMove(new ChessBoard(otherScenerioFlipped), new ChessMove(new ChessLocation(3, 3), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //            else
        //            {
        //                Assert.IsFalse(MoveValidation.validateQueenMove(new ChessBoard(otherScenerioFlipped), new ChessMove(new ChessLocation(3, 3), new ChessLocation(x, y)), ChessColor.White));
        //            }
        //        }
        //    }
        //}//End TestQueenValidation
        //#endregion
        #region KingInCheckTests
        [TestMethod]
        public void TestKingInCheckValidation()
        {
            string knightCheckingKing = "4p3/6n1/4K3/7P/P1P5/3P4/1N6/3k4";

            //checked by knight
            //01234567
            //____p___/0
            //______n_/1
            //____K___/2(4,2)
            //_______p/3
            //P_P_____/4
            //___P____/5
            //_N______/6
            //___k____ 7(3,7)
            //4p3/6n1/4K3/7P/P1P5/3P4/1N6/3k4
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(knightCheckingKing),
                  new ChessLocation(4, 2), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(knightCheckingKing),
                  new ChessLocation(3, 7), ChessColor.Black));
            string knightNotCheckingKing = "4p3/6n1/3K4/7P/P1P5/3P4/1N6/4k3";

            //not in check
            //01234567
            //____p___/0
            //______n_/1
            //___K____/2(4,2)
            //_____p_p/3
            //P_P_____/4
            //___P____/5
            //_N______/6
            //____k___ 7(3,7)
            //4p3/6n1/4p3/5p1p/P1P5/3P4/1N6/4k3
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(knightNotCheckingKing),
                new ChessLocation(4, 2), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(knightNotCheckingKing),
                new ChessLocation(3, 7), ChessColor.Black));

            //checked by rook
            //01234567
            //____p___/0
            //______N_/1
            //R___K__r/2(4,2) checked by (7,2)
            //_______p/3
            //P_P_____/4
            //___P____/5
            //_n_R____/6 checked by (3,6)
            //___k____ 7(3,7)
            //4p3/6n1/R3K2r/7P/P1P5/3P4/1N6/3k4
            string rookCheckingKing = "4p3/6N1/R3K2r/7P/P1P5/3P4/1n1R4/3k4";
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(rookCheckingKing),
                new ChessLocation(4, 2), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(rookCheckingKing),
                new ChessLocation(3, 7), ChessColor.Black));

            //not checked by rook
            //01234567
            //____p___/0
            //______N_/1
            //R___K__R/2(4,2) checked by (7,2)
            //_______p/3
            //P_P_____/4
            //___P____/5
            //_n_r____/6 checked by (3,6)
            //___k____ 7(3,7)
            //4p3/6n1/R3K2r/7P/P1P5/3P4/1N6/3k4
            string rookNotCheckingKing = "4p3/6N1/R3K2R/7P/P1P5/3P4/1n1r4/3k4";
            Assert.IsFalse(MoveValidation.kingInCheck(new ChessBoard(rookNotCheckingKing),
                new ChessLocation(4, 2), ChessColor.White));
            Assert.IsFalse(MoveValidation.kingInCheck(new ChessBoard(rookNotCheckingKing),
                new ChessLocation(3, 7), ChessColor.Black));



            //checked by bishop (check all possible directions
            //01234567
            //_K_K____/0(1,0)(3,0) king in check
            //__b____K/1(2,1) checking king
            //_k_K____/2(1,2)(3,2) king in check
            //_____k__/3(5,3) king in check
            //__k_____/4(2,4) king in check
            //___B____/5(3,5) checking king
            //____k___/6(4,6) king in check
            //_k______/7(1,7) king in check
            //
            string bishopCheckingKing = "1K1K4/2b4K/1K1K4/5k2/2k5/3B4/4k3/1k6";
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(bishopCheckingKing),
                new ChessLocation(1, 0), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(bishopCheckingKing),
                new ChessLocation(3, 0), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(bishopCheckingKing),
                new ChessLocation(1, 2), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(bishopCheckingKing),
                new ChessLocation(3, 2), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(bishopCheckingKing),
                new ChessLocation(5, 3), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(bishopCheckingKing),
                new ChessLocation(2, 4), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(bishopCheckingKing),
                new ChessLocation(4, 6), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(bishopCheckingKing),
                new ChessLocation(1, 7), ChessColor.Black));
            Assert.IsFalse(MoveValidation.kingInCheck(new ChessBoard(bishopCheckingKing),
                new ChessLocation(7, 1), ChessColor.White));

            //checked by Queen (check all possible directions)
            //01234567
            //_KKK____/0(1,0)(2,0)(3,0) king in check
            //__q____K/1(0,1)(7,1) checking king
            //_k_K____/2(1,2)(3,2) king in check
            //__Kk_k__/3(2,3)(3,3)(5,3) king in check
            //__k_____/4(2,4) king in check
            //_k_Q__k_/5(1,5)(3,5)(6,5) checking king
            //____k___/6(4,6) king in check
            //_k_k__k_/7(1,7)(3,7) king in check
            //
            string QueenCheckingKing = "1KKK4/2q4K/1K1K4/2Kk1k2/2k5/1k1Q2k1/4k3/1k1k1k2";
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(1, 0), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(2, 0), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(3, 0), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(7, 1), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(1, 2), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(3, 2), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(2, 3), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(3, 3), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(5, 3), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(2, 4), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(1, 5), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(6, 5), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(4, 6), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(1, 7), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(3, 7), ChessColor.Black));
            Assert.IsFalse(MoveValidation.kingInCheck(new ChessBoard(QueenCheckingKing),
                new ChessLocation(6, 7), ChessColor.Black));

            //checked by pawn
            //01234567
            //________/0
            //___pp___/1
            //_K__K___/2(1,2)not in check, (4,2) in check
            //__p_____/3
            //__P_____/4
            //_k__k___/5(1,5)not in check, (4,5) in check
            //____pp__/6
            //________ 7
            //8/3pp3/1K2K3/2p5/2P5/1k2k3/4PP3/8
            string pawnCheckingKing = "8/3pp3/1K2K3/2p5/2P5/1k2k3/4PP3/8";
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(pawnCheckingKing),
                new ChessLocation(4, 2), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(pawnCheckingKing),
                new ChessLocation(4, 5), ChessColor.Black));
            Assert.IsFalse(MoveValidation.kingInCheck(new ChessBoard(pawnCheckingKing),
                new ChessLocation(1, 2), ChessColor.White));
            Assert.IsFalse(MoveValidation.kingInCheck(new ChessBoard(pawnCheckingKing),
                new ChessLocation(1, 5), ChessColor.Black));


            //checked by king?
            //01234567
            //__KKK___/0(2,0)(3,0)(4,0)
            //__KkK___/1
            //__KKK___/2
            //_______K/3
            //________/4
            //kkk___k_/5
            //kKk_____/6
            //kkk_____/7
            //2KKK3/2KkK3/2KKK3/7K/8/kkk3k1/kkk5/kkk5
            string kingCheckingKing = "2KKK3/2KkK3/2KKK3/7K/8/kkk3k1/kkk5/kkk5";
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(2, 0), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(3, 0), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(4, 0), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(2, 1), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(4, 1), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(2, 2), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(3, 2), ChessColor.Black));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(4, 2), ChessColor.Black));

            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(0, 5), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(1, 5), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(2, 5), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(0, 6), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(2, 6), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(0, 7), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(1, 7), ChessColor.White));
            Assert.IsTrue(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(2, 7), ChessColor.White));
            Assert.IsFalse(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(6, 5), ChessColor.Black));
            Assert.IsFalse(MoveValidation.kingInCheck(new ChessBoard(kingCheckingKing),
                new ChessLocation(7, 3), ChessColor.White));


        }//end KingInCheckValidation
        #endregion

        //#region KingInCheckmateTests
        //[TestMethod]
        //public void testKingInCheckmate()
       // {
        //    return true;
        //}
        //#endregion

    }
}
